package com.sys.basics.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sys.basics.entity.vo.ScheduleLogsVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import com.sys.basics.entity.SysScheduleJobLog;
import com.sys.basics.dao.SysScheduleJobLogDao;
import com.sys.basics.service.SysScheduleJobLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @author: ares
 * @date: 2021-10-29
 * @description: 定时任务日志表 服务实现类
 */
@Slf4j
@Service
public class SysScheduleJobLogServiceImpl extends ServiceImpl<SysScheduleJobLogDao, SysScheduleJobLog> implements SysScheduleJobLogService {
    @Autowired
	SysScheduleJobLogDao sysScheduleJobLogDao;

    @Override
    public int recordLog(SysScheduleJobLog sysScheduleJobLog) {
        return sysScheduleJobLogDao.insert(sysScheduleJobLog);
    }

    @Override
    public int clear() {
        return sysScheduleJobLogDao.delete(null);
    }

    @Override
    public int batchRemove(List<Long> ids) {
        return sysScheduleJobLogDao.deleteBatchIds(ids);
    }

    @Override
    public IPage<ScheduleLogsVo> getPageList(Page<ScheduleLogsVo> page, ScheduleLogsVo log) {
        return sysScheduleJobLogDao.getPageList(page, log);
    }
}
